package exception;

public class ThrowDemo {
    public static void main(String[] args) {
        Person p = new Person();
        //p.setAge(18);
        try {
            p.setAge(10000);//程序可运行，但不符合业务需求
        } catch (IllegalAgeException e) {
            e.printStackTrace();
        }

        System.out.println("此人年龄:"+p.getAge()+"岁");
    }
}
